#include "ClientPlayer.h"

ClientPlayer::ClientPlayer(int pPlayerId, std::vector<string> * initVector)
{
	moons = new vector<int>();
	playerId = pPlayerId;
	init(initVector);
}

int ClientPlayer::getPlayerId()
{
	return playerId;
}

string ClientPlayer::getPlayerName()
{
	return playerName;
}

vector<int> * ClientPlayer::getMoons()
{
	return moons;
}

void ClientPlayer::init(std::vector<string> *initVector)
{
	
	moons = new vector<int>();
	vector<string>::iterator it2 = (*initVector).begin();
	//ignore first element "Player"
	it2++;
	//ignore second element, playerId
	it2++;
	playerName = *it2;
	it2++;
	while(it2 != (*initVector).end())
	{
		(*moons).insert( (*moons).end(), atoi((*it2).c_str()));
		it2++;
	}

	
}